<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<!DOCTYPE html>
<html lang="zh-CN">
	<head> 
    <meta charset="UTF-8">
    <%@ include file="/WEB-INF/views/include/head.jsp"%>
    <link rel="stylesheet" href="${ctxStatic}/css/common_erp.css">
    <link rel="stylesheet" href="${ctxStatic}/css/layerSm.css"> 
    <c:set var="statusWaitAccept" value="<%=ResourcesUtil.getConfig(\"specimen_production_status_wait_accept\")%>" />
    <c:set var="statusWaitDone" value="<%=ResourcesUtil.getConfig(\"specimen_production_status_done\")%>" />
	<c:set var="varSampleRequestStatus" value="<%=ResourcesUtil.getConfig(\"sampleRequestStatus\")%>" />
    <script>
	    var statusWaitAccept = "${statusWaitAccept}";
	    var statusWaitDone = "${statusWaitDone}";
	    $(function(){
			if(${specimenProduction.sampleProductionStatus == statusWaitDone}){  //待验收
				funBtnDisable();
	        }	
		});
		
	    function funBtnDisable(){
	    	$("#btnEdit").hide();
	    }
	    
	    function funBtnEnable(){
	    	$("#btnEdit").show();
	    }
	    //上传图片画面 
	    function uploadFile() {
	    	popup('510px','350px','${ctx}/specimen/production/uploadFileImage?id=${specimenProduction.id}');
		}
	</script>
    </head>
	<body>
	<div class="layerHeader clearfix">
		<p class="headerTitle"><spring:message code="specimenProduct_edit_title"/></p>
	    <div class="headerButton clearfix">
	    	<button type="button" onclick="uploadFile();">上传图片</button>
	    	<shiro:hasPermission name="specimen:production:audit">
	    	<button type="button" onclick="popup('800px','519px','${ctx}/specimen/production/audit?id=${specimenProduction.id}')"><spring:message code="pecimenProduct_btn_accept"/></button>
			<c:if test="${ specimenProduction.sampleProductionStatus eq varSampleRequestStatus}">
				<button type="button" onclick="popup('900px','584px','${ctx}/slopwork/inrequest/form?statusFlg=${specimenProduction.id}')"><spring:message code="samply_in"/></button>
			</c:if>
	    	</shiro:hasPermission>
	    	<shiro:hasPermission name="specimen:production:edit">
	        <button id="btnEdit" type="button" onClick="window.location.href='${ctx}/specimen/production/form?id=${specimenProduction.id}'"><spring:message code="pecimenProduct_btn_edit"/></button>
	        </shiro:hasPermission>
	        <button type="button" onclick="closeWin()"><spring:message code="btn_cancle"/></button>
	    </div>
	</div>
	
	<div class="tabBoxSm showHtml">
    	<div class="tabSm smOrderBox">
	        <p class="title"><spring:message code="pecimenProduct_tabpage_title"/></p>
	        <shiro:hasPermission name="specimen:production:view">
	        <div class="items clearfix">
	        	<div class="col-25 clearfix">
	                <p class="tit" style="width:75px;"><spring:message code="pecimenProduct_template_start_date"/></p>
	                <p><fmt:formatDate value="${specimenProduction.templateStartDate}" pattern="yyyy-MM-dd" /></p>
	            </div>
	            <div class="col-25 clearfix">
	                <p class="tit" style="width:75px;"><spring:message code="pecimenProduct_template_end_date"/></p>
	                <p><fmt:formatDate value="${specimenProduction.templateEndDate}" pattern="yyyy-MM-dd" /></p>
	            </div>
	            <div class="col-25 clearfix">
	                <p class="tit"><spring:message code="pecimenProduct_template_costtime"/></p>
	                <p><fmt:formatNumber value="${specimenProduction.templateCostTime}" pattern="#,##0.##"/></p>
	            </div>
	            <div class="col-25 clearfix">
	                <p class="tit"><spring:message code="pecimenProduct_template_user"/></p>
	                <p>${specimenProduction.templateUserName}</p>
	            </div>
	        </div> 
	        </shiro:hasPermission>
	        <shiro:hasPermission name="specimen:production:view">
	        <div class="items clearfix">
	        	<div class="col-25 clearfix">
	                <p class="tit" style="width:75px;"><spring:message code="pecimenProduct_sample_start_date"/></p>
	                <p><fmt:formatDate value="${specimenProduction.sampleStartDate}" pattern="yyyy-MM-dd" /></p>
	            </div>
	            <div class="col-25 clearfix">
	                <p class="tit" style="width:75px;"><spring:message code="pecimenProduct_sample_end_date"/></p>
	                <p><fmt:formatDate value="${specimenProduction.sampleEndDate}" pattern="yyyy-MM-dd" /></p>
	            </div>
	            <div class="col-25 clearfix">
	                <p class="tit"><spring:message code="pecimenProduct_template_costtime"/></p>
	                <p><fmt:formatNumber value="${specimenProduction.sampleCostTime}" pattern="#,##0.##"/></p>
	            </div>
	            <div class="col-25 clearfix">
	                <p class="tit"><spring:message code="pecimenProduct_sample_user"/></p>
	                <p>${specimenProduction.sampleUserName}</p>
	            </div>	            
	        </div>
	        </shiro:hasPermission>
	        <shiro:hasPermission name="specimen:production:view"> 
	        <div class="items clearfix">
	        	<div class="col-25 clearfix">
	                <p class="tit" style="width:75px;"><spring:message code="pecimenProduct_sample_material_cost"/></p>
	                <p><fmt:formatNumber value="${specimenProduction.sampleMaterialCost}" pattern="#,##0.##"/></p>
	            </div>
	            <div class="col-25 clearfix">
	                <p class="tit" style="width:75px;"><spring:message code="pecimenProduct_sample_manday_cost"/></p>
	                <p><fmt:formatNumber value="${specimenProduction.sampleMandayCost}" pattern="#,##0.##"/></p>
	            </div>
	            <div class="col-25 clearfix">
	                <p class="tit"><spring:message code="pecimenProduct_sample_other_cost"/></p>
	                <p><fmt:formatNumber value="${specimenProduction.sampleOtherCost}" pattern="#,##0.##"/></p>
	            </div>
	            <div class="col-25 clearfix">
	                <p class="tit"><spring:message code="pecimenProduct_sample_cost"/></p>
	                <p><fmt:formatNumber value="${specimenProduction.sampleCost}" pattern="#,##0.##"/></p>
	            </div>	            
	        </div>
	        </shiro:hasPermission> 	        
	        <div class="items clearfix">
	        	<p class="tit"><spring:message code="pecimenProduct_remark"/></p>
	            <pre class="txt proList">${specimenProduction.sampleRemark}</pre>
	        </div> 
		</div>
    </div>
</body>
</html>